/* 
 * File:   main.c
 * Author: Prince Annan Koomson (PAK)
 *
 * Created on December 16, 2011, 2:21 AM
 */

/*
 * 
 */
#include <stdio.h>
#include <getopt.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <time.h>
#include "src/functions.c"
#include "src/function_month.c"
#include "src/cdate.c"
#include <time.h>

int main(int argc, char *argv[]) {

    int val;
    char *gmbd;

    struct option long_options[] = {
        /* Options without arguments */
        {"help", no_argument, NULL, 'h'},
        {"version", no_argument, NULL, 'v'},
        {"today", no_argument, NULL, 't'},
        {"show", no_argument, NULL, 's'},
        {"list", optional_argument, NULL, 'l'},
        {"month", required_argument, NULL, 'm'},
        {"date", required_argument, NULL, 'd'},
        {NULL, 0, NULL, 0}
    };

    while ((val = getopt_long(argc, argv, "vtshld:m:", long_options, NULL)) != -1) {
        switch (val) {
            case 'v':
                print_version();
                exit(0);
                break;
            case 't':
                getDayAndMonth();
                
                break;

            case 's':                
                getMonthByDate();
                break;

            case 'l':
                print_months();
                break;

            case 'm':
                by_month(optarg);
                break;

            case 'd':
                defineMonths(optarg);
                //printf("%s",optarg);
                break;

            case 'h':
            case '?':
            default:
                print_help();
                exit(0);
                break;
        }
    }

    end_of_file();
    printf("\n");
}
